package bTree.LeetCode;

import java.util.Arrays;

public class 按奇偶排序数组II {
    public int[] sortArrayByParityII(int[] nums) {
        for (int i = 0; i < nums.length; i++) {
            if (i%2==nums[i]%2){
                continue;
            }
            for (int j=i+1;j<nums.length;j++){
                if (i%2==nums[j]%2){
                    int num = nums[i];
                    int num1 = nums[j];
                    nums[i]=num1;
                    nums[j]=num;
                }
            }
        }
        return nums;
    }
}